<!DOCTYPE html>
<html>

<head>
    <!-- <meta charset="utf-8"> -->
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <title>BaiduMap_Hello</title>
    <style type="text/css">
        html {
            height: 100%
        }

        body {
            height: 100%;
            margin: 0px;
            padding: 0px
        }

        #container {
            height: 100%
        }
    </style>
    <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=EHEQP4Ept6uvPImZEwPd0zAvVWUU7hpO">
    </script>
</head>

<body>
    <div id="container"></div>
    <script type="text/javascript">
        var map = new BMap.Map("container");
        var point = new BMap.Point(120.15507, 30.25348); // 杭州西湖的经纬度坐标
        map.centerAndZoom(point, 16); // 设置缩放级别为16

        var points = [
            new BMap.Point(120.141081, 30.258531), // 岳王庙
            new BMap.Point(120.149058, 30.256348), // 中山公园
            new BMap.Point(120.152508, 30.258282), // 平湖秋月
            new BMap.Point(120.158814, 30.265191), // 白堤
            new BMap.Point(120.16406, 30.265877), // 风波亭
            new BMap.Point(120.165286, 30.262684) // 湖滨公园
        ];

        // 添加标记
        for (var i = 0; i < points.length; i++) {
            var marker = new BMap.Marker(points[i]);
            map.addOverlay(marker);
        }

        // 连接地点
        var polyline = new BMap.Polyline(points, { strokeColor: "blue", strokeWeight: 2, strokeOpacity: 0.5 });
        map.addOverlay(polyline);
    </script>
</body>

</html>